<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ taglib prefix="portal" uri="http://amc.af.mil/portal-el" %>
<%@ taglib prefix="rad" uri="http://amc.af.mil/radtaglibrary" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<html>
<head>
    <title>Create Hand Receipt</title>
    <script type="text/javascript" src="js/yahooui/yahoo.js"></script>
    <script type="text/javascript" src="js/yahoo/event.js"></script>
    <script type="text/javascript" src="js/yahoo/dom.js"></script>
    <script type="text/javascript" src="js/yahoo/calendar.js"></script>
    <script type="text/javascript">
        YAHOO.namespace("createHandReceipt.issueDate");
        YAHOO.namespace("createHandReceipt.returnDate");

        YAHOO.createHandReceipt.issueDate.init = function() {
            YAHOO.createHandReceipt.issueDate.call = new YAHOO.widget.Calendar("call", "issueDate");
            YAHOO.createHandReceipt.issueDate.call.render();
        }

        YAHOO.createHandReceipt.returnDate.init = function() {
            YAHOO.createHandReceipt.returnDate.call = new YAHOO.widget.Calendar("call", "returnDate");
            YAHOO.createHandReceipt.returnDate.call.render();
        }

        YAHOO.util.Event.onDOMReady(YAHOO.createHandReceipt.issueDate.init);
        YAHOO.util.Event.onDOMReady(YAHOO.createHandReceipt.returnDate.init);

        YAHOO.createHandReceipt.issueDate.call.selectEvent.subscribe(updateDateTextBox, YAHOO.createHandReceipt.issueDate, true);
        YAHOO.createHandReceipt.returnDate.call.selectEvent.subscribe(updateDateTextBox, YAHOO.createHandReceipt.returnDate, true);

    </script>
</head>

<body>
<rad:useBean id="adpeAccountViewHelper"/>
<rad:useBean id="userViewHelper"/>

<html:form action="createHandReceipt.do" method="post">
    <p><label for="adpeAccountId">ADPE Account</label>
        <html:select property="adpeAccountId" styleId="adpeAccountId">
            <html:optionsCollection name="adpeAccountViewHelper"
                                    property="allByAdpeAccount"
                                    value="id"
                                    label="name"/>
        </html:select></p>

    <p>
        <label for="issueDate">Issue Date</label>
        <html:text property="issueDate" disabled="disabled" maxlength="20"/>
        <div id="issueDateCalendar"></div>
    </p>

    <p>
        <label for="returnDate">Due Date</label>
        <html:text property="returnDate" disabled="disabled" maxlength="20"/>
        <div id="returnDateCalendar"></div>
    </p>

    <p>
        <label for="assignedUserOrganization">User Organization</label>
        <html:select property="userOrganization"/>
    </p>

    <p>
        <label for="assignedUser">Assigned User</label>
        <html:select property="assignedUser"/>
    </p>

    <p><label for="search">Serial</label><html:text property="search" styleId="search"/>
        <input type="button" value="Search" onclick="javascript:addDrmoPackageItemBySerial()"/>

        <div id="searchStatus">

        </div>

        <table style="width:100%" id="itemTable">
            <tbody id="header">
                <tr id="itemTableHeader">
                    <th>Serial</th>
                    <th>Description</th>
                    <th>Actions</th>
                </tr>
            </tbody>
            <tbody id="content">

            </tbody>
        </table>

        <p><html:submit title="Create Hand Receipt"/></p>
    </p>
</html:form>
</body>
</html>